const INITIAL_STATE = {
	pid: "",
	name: "",
	avatarUrl: "",
	nickName: "",
	userId: undefined,
}

export default function userInfo (state = INITIAL_STATE, action) {
	switch (action.type) {
		case "UPDATE_USER_INFO":
			return {
				...state,
				pid: action.payload.pid,
				name: action.payload.name,
				avatarUrl: action.payload.avatarUrl,
				nickName: action.payload.nickName,
				userId: action.payload.userId,
			}
		default:
			return state
	}
}
